package com.micro.modual.extension;

import com.micro.common.MicroConstant;
import com.micro.common.biz.GeneratorCodeUtil;
import com.micro.common.util.SnowFlakeUtil;
import com.micro.modual.entity.GoodsBrand;
import com.micro.modual.entity.GoodsBrandCategory;
import com.micro.modual.entity.GoodsCategory;
import com.micro.modual.model.bo.goodsbrandcategory.GoodsBrandCategoryBO;

/**
 * <h1>商品品牌分类关联表 延展类</h1>
 *
 * @author LevelCoder
 * @version V1.0.0
 * @email LevelCoder@126.com
 * @date 2020-08-04 00:23:27
 */
public class GoodsBrandCategoryExtension {

    /**
     *
     * @param goodsBrand
     * @param goodsCategory
     * @return
     */
    public static GoodsBrandCategory converAddGoodsBrandCategory(GoodsBrand goodsBrand, GoodsCategory goodsCategory) {
        GoodsBrandCategory goodsBrandCategory = new GoodsBrandCategory();
        goodsBrandCategory.setId(SnowFlakeUtil.getId());
        goodsBrandCategory.setCategoryCode(goodsCategory.getCategoryCode());
        goodsBrandCategory.setCategoryName(goodsCategory.getCategoryName());
        goodsBrandCategory.setBrandCode(goodsBrand.getBrandCode());
        goodsBrandCategory.setBrandName(goodsBrand.getBrandName());
        return goodsBrandCategory;

    }

    /**
     * <h2>转换: 商品品牌分类关联表 修改</h2>
     *
     * @param goodsBrandCategoryBO {@link GoodsBrandCategoryBO} 商品品牌分类关联表 新增/修改 请求对象
     * @return {@link GoodsBrandCategory} 商品品牌分类关联表
     */
    public static GoodsBrandCategory converEditGoodsBrandCategory(GoodsBrandCategoryBO goodsBrandCategoryBO) {
        GoodsBrandCategory goodsBrandCategory = new GoodsBrandCategory();
        goodsBrandCategory.setId(goodsBrandCategoryBO.getId());
        goodsBrandCategory.setBrandCode(goodsBrandCategoryBO.getBrandCode());
        goodsBrandCategory.setCategoryCode(goodsBrandCategoryBO.getCategoryCode());
        goodsBrandCategory.setBrandName(goodsBrandCategoryBO.getBrandName());
        goodsBrandCategory.setCategoryName(goodsBrandCategoryBO.getCategoryName());
        return goodsBrandCategory;
    }
}
